C code for PEGetSQLQuery and PESetSQLQuery

Use the following code as an example of how to get the text in a SQL query with PEGetSQLQuery, and how to change a SQL query with PESetSQLQuery:

PEGetSQLQuery

HANDLE        textHandle;
short        textLength;
char        *textString;
if (!PEGetSQLQuery(Job, &textHandle, &textLength)){
    // Handle error
}
// Allocate buffer
textString = (char*)malloc(textLength);
if (!PEGetHandleString(textHandle, textString, textLength)){
    // Handle error
}
    // textString now contains the SQL query

PESetSQLQuery

char queryString [] = "SELECT orders.ORDERNUM, orders.AMOUNT
            FROM sales.orders orders
            WHERE orders.AMOUNT > 1000.00";
if (!PESetSQLQuery(Job, queryString)){
    // Handle error
}


Seagate Software IMG Holdings, Inc.
http://www.seagatesoftware.com
Support services:
http://support.seagatesoftware.com